<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>登录</title>
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&amp;subset=latin" rel="stylesheet">
    <link href="<@spring.url "/resources/css/bootstrap.min.css"/>" rel="stylesheet">
    <link href="<@spring.url "/resources/css/nifty.min.css"/>" rel="stylesheet">
    <link href="<@spring.url "/resources/premium/icon-sets/icons/line-icons/premium-line-icons.min.css"/>" rel="stylesheet">
    <link href="<@spring.url "/resources/premium/icon-sets/icons/solid-icons/premium-solid-icons.min.css"/>" rel="stylesheet">
    <script src="<@spring.url "/resources/js/jquery.min.js"/>"></script>
    <script src="<@spring.url "/resources/js/bootstrap.min.js"/>"></script>
    <script src="<@spring.url "/resources/js/pace.min.js"/>"></script>
    <script src="<@spring.url "/resources/js/common.js"/>"></script>
</head>
<body>
<div id="container" class="cls-container">
    <div class="cls-content">
        <div class="cls-content-sm panel">
            <div class="panel-body">
                <div class="mar-ver pad-btm">
                    <h1 class="h3">后台用户登录</h1>
                </div>
                <div class="form-group">
                    <input type="text" class="form-control" name="passport" id="passport" placeholder="输入登陆账号" autofocus>
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" name="password" id="password" placeholder="输入密码">
                </div>
                <button class="btn btn-primary btn-lg btn-block" id="loginBtn" type="button">登陆</button>
            </div>

            <div class="pad-all">
                <a href="<@spring.url "/manage/forgetpassword" />" class="btn-link mar-rgt">忘记密码</a>
                <div class="pad-top " style="color: red" id="errorInfo">
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        $("#loginBtn").click(function(){
            var passport=$("#passport").val();
            if(!isNotNull(passport)){
                $("#errorInfo").html("手机号码不能为空！");
                return false;
            }
            var password=$("#password").val();
            if(!isNotNull(password)){
                $("#errorInfo").html("密码不能为空！");
                return false;
            }
            $.post('<@spring.url "/manage/login" />',
                {passport:passport, password:password},
                function (data) {
                    if(data.code==1){
                        window.location.href="<@spring.url "/manage/companyInfo/newCompany" />";
                    }else{
                        $("#errorInfo").html(data.message);
                    }
                });
        });
    });
</script>
</body>
</html>
